package view.dialogs;

import javax.swing.JPanel;

import view.listeners.AddIpListener;
import view.listeners.CancelListener;
import view.views.dialogButtonViews.AddIpButtonPanel;
import view.views.dialogContentViews.AddSimpleIPContentPanel;

/**
 * @author Alexander Müller
 * 
 */
public class AddSimpleIpDialog extends Dialog {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private AddSimpleIPContentPanel content;


	public AddSimpleIpDialog(String title) {
		super(title);
	}

	@Override
	protected JPanel addContent() {
		AddSimpleIPContentPanel ipPanel = new AddSimpleIPContentPanel();
		content = ipPanel;
		return ipPanel;

	}

	@Override
	protected JPanel addButtons() {

		AddIpButtonPanel buttons = new AddIpButtonPanel();

		buttons.getCancelButton().addActionListener(new CancelListener(this));

		buttons.getAddButton().addActionListener(
				new AddIpListener(this, content));

		return buttons;

	}


}
